<?php
class TiController extends BaseController
{

	public function actionIndex(){
		
		echo 'ti index';
		$this->display('ti_index.tpl');
	}

	public function actionDetail(){  //具体的题目
		$id = (int) $_GET['id'];
		$ti = obj('Ti')->find(array('id'=>$id),'');
		
		//分页设置
		$pre_count = 10;
		$p = empty($_GET['p']) ? 1 : (int)$_GET['p'];

		$replys = obj('Ti_re')->select(array('ti_id'=>$id),'','cr_time desc',array($p,$pre_count));
		
		$this->page = obj('Ti_re')->page;
		$this->replys = $replys;
		$this->ti = $ti;
		$this->display('ti_detail.tpl');
	}
}